package com.crm.util;

import java.util.List;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import com.alibaba.fastjson.JSON;
import com.crm.sys.model.RobotMessage;
import com.crm.sys.model.RobotMessageArticle;

public class bot {
 public static void main(String[] args) {
	 
	 
	   
	 
	 try{
			Document doc = Jsoup.connect("http://www.tuling123.com/openapi/api").timeout(62000).data("key","c69b0f5d64ed4528ab62a324a0cb67cc").data("userid","123").data("info","我想看新闻").post();
			String ss = doc.select("body").html().replace("&quot;", "'") ;
			System.out.println(ss);
			RobotMessage sss=	JSON.parseObject(ss,RobotMessage.class);
			List<RobotMessageArticle>  sssss = JSON.parseArray(sss.getList(), RobotMessageArticle.class);
			String html ="";
			for(RobotMessageArticle a :sssss){
				 html+="["+a.getArticle()+":"+a.getDetailurl()+"]      ";
			}
			System.out.println(html);
		}catch(Exception e){
			e.printStackTrace();
		}
	 
  }
}
